package com.cykj.service.impl;


import com.cykj.mapper.UserMapper;
import com.cykj.pojo.CyAdmin;
import com.cykj.service.UserService;
import com.cykj.util.ResponseDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Value("zhangsan")
    private String name;

    @Autowired
    private UserMapper userMapper;
    @Override
    public ResponseDto login(String acc, String pwd) {
        CyAdmin admin = userMapper.login(acc, pwd);
        if (admin != null){
            return new ResponseDto(1,"登录成功",admin);
        }else {
            return new ResponseDto(0,"账号或者密码错误",null);
        }

    }

}
